package com.airbat.prize.common.enums;

import com.airbat.prize.common.core.LongArrayValuable;
import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Arrays;

/**
 * 线索状态
 */
@Getter
@AllArgsConstructor
public enum ClueChildrenStateEnum implements LongArrayValuable {

    DQS(1, "待签收"),
    CZZ(2, "处置中"),
    SPZ(3, "审批中"),
    YWJ(4, "已完结");

    /**
     * 值
     */
    private final long value;
    /**
     * 名称
     */
    private final String name;

    public static final long[] ARRAYS = Arrays.stream(values()).mapToLong(ClueChildrenStateEnum::getValue).toArray();

    @Override
    public long[] array() {
        return ARRAYS;
    }

    public static ClueChildrenStateEnum getEnum(long value) {
        return Arrays.stream(values()).filter(tr -> tr.getValue() == value).findFirst().get();
    }

}
